package com.acme.bankapp.server.command;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.client.Client;

public class ListCommand extends BankCommand {

	public ListCommand(Bank bank, String arg) {
		super(bank, arg);
	}

	@Override
	public String execute() {
		StringBuilder sb = new StringBuilder("List of clients:\n");
		for (Client client : bank.getClients()) {
			sb.append(String.format("%s%n", client));
		}
		return sb.toString();
	}

}
